<script setup>
	import { onLoad, onShow } from '@dcloudio/uni-app'
	import { replaceWhite } from '@/utils/index.js'
	import { ref } from 'vue'
	import { http } from '@/utils/http.js'

	const id = ref('')
	const details = ref('')

	async function getDetail() {
		const res = await http.request({
			url: '/api/config/activeDetails',
			method: 'POST',
			data: {
				id: id.value,
			},
		})
		details.value = replaceWhite(res.data.details)
	}

	onLoad((option) => {
		console.log(option.id)
		id.value = option.id
		getDetail()
	})
</script>

<template>
	<view class="activity-rich">
		<rich-text :nodes="details"></rich-text>
	</view>
</template>

<style lang="scss" scoped>
	.activity-rich {
		height: 100vh;
	}
</style>
